home *** CD-ROM | disk | FTP | other *** search
- Path: library.erc.clarkson.edu!rpi!not-for-mail
- From: floydb1@lib104.its.rpi.edu (Barry B Floyd)
- Newsgroups: comp.lang.c++
- Subject: HELP: syntax calling member fn() of returned object
- Date: 11 Jan 1996 12:13:19 -0500
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
- Message-ID: <4d3gff$ga4@lib104.its.rpi.edu>
- NNTP-Posting-Host: lib104.its.rpi.edu
- X-newsreader: xrn 7.04-beta-11
-
-
-
- What is the syntax (if any) for calling a member function
- of a returned object. For example:
-
- // --------------------------------------
- String MyClass::Function ( ... )
- {
- // code
- }
-
- // --------------------------------------
- int Myclass::AnotherFn ( ... )
- {
- String a_string ;
-
- a_string = Function ( ... ) ;
-
- if ( a_string.length () == 0 )
- // code
- }
-
- // --------------------------------------
-
- I would rather not have to do:
-
- String a_string ;
-
- a_string = Function ( ... ) ;
-
- I would rather do something like:
-
- if ( Function ( ... ).length () == 0 )
-
-
-
-
- thanks (e-mail or post)
-
- barry
- --
- +--------------------------------------------------------------------+
- | Barry B. Floyd \\\ floydb1@rpi.edu |
- | RPI Alum. '84 '87 '88 \\\ |
- +--------------------------------------------------------------------+
-